﻿<Window x:Class="TypograFix.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:dv="clr-namespace:DenisVuyka.Controls.PropertyGrid;assembly=DenisVuyka.Controls.PropertyGrid"
    Title="TypograFix" Height="400" Width="600" WindowStartupLocation="CenterScreen"
        Loaded="Window_Loaded" Closed="Window_Closed">
  <Window.Background>
    <LinearGradientBrush>
      <GradientStop Color="Black"/>
      <GradientStop Color="#333333"/>
    </LinearGradientBrush>
  </Window.Background>
  <Window.Resources>
    <ResourceDictionary>
      <Style TargetType="TextBlock">
        <Setter Property="Foreground" Value="White"/>
      </Style>
      <Style TargetType="Run">
        <Setter Property="Foreground" Value="White"/>
      </Style>
      <Style TargetType="TextBox">
        <Setter Property="TextWrapping" Value="Wrap"/>
      </Style>
    </ResourceDictionary>
  </Window.Resources>
  <Grid Background="Black">
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto"/>
      <RowDefinition />
      <RowDefinition Height="Auto"/>
      <RowDefinition/>
    </Grid.RowDefinitions>

    <Grid.ColumnDefinitions>
      <ColumnDefinition/>
      <ColumnDefinition Width="Auto"/> 
      <ColumnDefinition Width="5"/>
      <ColumnDefinition/>
    </Grid.ColumnDefinitions>

    <TextBlock Margin="10,5,5,5" TextWrapping="Wrap" Grid.ColumnSpan="2">
      <Run FontWeight="Bold">Html </Run>
      <Hyperlink Name="lnkPaste" Foreground="White" Click="lnkPaste_Click">paste from clipboard</Hyperlink>
      <Hyperlink Name="lnkFormat" Foreground="White">format</Hyperlink>
    </TextBlock>

    <Border BorderBrush="White" CornerRadius="5" BorderThickness="5" Grid.Row="1" Margin="5">
      <TextBox AcceptsReturn="True" FontFamily="Consolas"
               Name="tbIn" TextChanged="tbIn_TextChanged" VerticalScrollBarVisibility="Auto" 
               HorizontalScrollBarVisibility="Auto" BorderThickness="0"/>
    </Border>
    
    <TextBlock Margin="10,5,5,5" TextWrapping="Wrap" Grid.ColumnSpan="2" Grid.Row="2">
      <Run FontWeight="Bold">Output </Run>
      <Hyperlink Name="lnkCopy" Foreground="White" Click="lnkCopy_Click">copy to clipboard</Hyperlink>
      <Hyperlink Name="lnkCopyAndMinimize" Foreground="White" Click="lnkCopyAndMinimize_Click">and minimize</Hyperlink> 
    </TextBlock>

    <Border BorderBrush="White" CornerRadius="5" BorderThickness="5" Grid.Row="3" Grid.Column="0" Margin="5">
      <TextBox AcceptsReturn="True" FontFamily="Consolas"
               Name="tbOut" VerticalScrollBarVisibility="Auto" 
               HorizontalScrollBarVisibility="Auto" BorderThickness="0"/>
    </Border>

    <dv:PropertyGrid Grid.Column="1" Grid.RowSpan="4" x:Name="propGrid" HorizontalContentAlignment="Right"
                     ShowPropertyFilter="False" Width="200" MinWidth="200" MaxWidth="200">
    </dv:PropertyGrid>

    <GridSplitter Grid.Column="2" Grid.Row="0" Grid.RowSpan="4" Width="Auto" ResizeDirection="Columns"
                  Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                  />
    
    <WindowsFormsHost Grid.Column="3" Grid.Row="1" x:Name="winFormsHost" 
                      Grid.RowSpan="3" Margin="5"/>
  </Grid>
</Window>
